import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86138
 * Date: 2024-07-14
 * Time: 13:11
 */
public class Seven {
    //给定一个字符串 s ，找到 它的第一个不重复的字符，并返回它的索引 。如果不存在，则返回 -1
    public static int First() {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int[] count = new int[256];
        for (int i = 0; i < s.length(); i++) {
            count[s.charAt(i) - 'a']++;
        }

        for (int i = 0; i < s.length(); i++) {
            if(1 == count[s.charAt(i) - 'a']){
                return i;
            }
        }
        return -1;
    }

    public static void main1(String[] args) {
        int ret = First();
        System.out.println(ret);
    }

    public static void main2(String[] args) {
        String s = "hello world";
        String[] ss = s.split(" ");
        System.out.println(Arrays.toString(ss));
    }


    public static boolean isNumberOrLetter(char ch){
        if(Character.isDigit(ch)||Character.isLetter(ch)){
            return true;
        }
        return false;
    }
    public static boolean isPalindrome(String s) {
        //如果在将所有大写字符转换为小写字符、并移除所有非字母数字字符之后，短语正着读和反着读都一样。则可以认为该短语是一个 回文串 。
        //它是 回文串 ，返回 true ；否则，返回 false
        s = s.toLowerCase();
        int left = 0;
        int right = s.length()-1;
        while(left<right){
            while(left<right && !isNumberOrLetter(s.charAt(left))){
                left++;

            }while(left<right && !isNumberOrLetter(s.charAt(right))){
                right--;
            }
            if(s.charAt(left) == s.charAt(right)){
                left++;
                right--;
            }else{
                return false;
            }

        }
        return true;
    }

    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        boolean ret = isPalindrome(s);
        System.out.println(ret);
    }

    public String toLowerCase(String s) {
        return s.toLowerCase();
    }


    public static int countSegments(String s) {
        String[] ss = s.split( " ");
        return ss.length;
    }
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        int ret = countSegments(s);
        System.out.println(ret);
    }
}
